package br.inf.battleship.v02;

import java.awt.Point;

public class Player {
    // sets the quantity of ships

    private  final int amountOfShips = 5;
    // the name of the player
    protected String name;
    protected BoardManager board = new BoardManager();
    // the ships
    Ship shipArray[] = new Ship[amountOfShips];
    protected int pontuation = 0;
    public static final int TYPE_AIRCRAFT_CARRIER = 0;// Porta-aviões 5 quadrados adjacentes
    public static final int TYPE_BATTLESHIP = 1;     // Navio de Gerra 4 quadrados adjacentes
    public static final int TYPE_FRIGATE = 2;       // Fragata 3 quadrados adjacentes
    public static final int TYPE_SUBMARINE = 3;    // Submarino 3 quadrados adjacentes
    public static final int TYPE_MINESWEEPER = 4; // Caça-minas 3 quadrados adjacentes

    public Player() {
    }

    public Player(String name) {
        this.name = name;
        shipArray[0] = new Ship("Porta-aviões", TYPE_AIRCRAFT_CARRIER, 5);
        shipArray[1] = new Ship("Navio de Gerra", TYPE_BATTLESHIP, 4);
        shipArray[2] = new Ship("Fragata", TYPE_FRIGATE, 3);
        shipArray[3] = new Ship("Submarino",TYPE_SUBMARINE, 3);
        shipArray[4] = new Ship("Caça-minas", TYPE_MINESWEEPER, 3);

    }

    public String getName() {
        return name;
    }

    public Point attack() {
        return null;
    }
    /* insere os barcos no tabuleiro
     * metodo implementado nas classes herdadas,
     * ele foi implementado aqui para
     * questões de polimorfismo
     */

    public void setShipLocation() {
    }

    public boolean isWinner() {
        return (pontuation == amountOfShips);
    }

    public BoardManager getBoard() {
        return board;
    }
}

